class car:
    def __init__(self,make,model,year):
        self.make = make
        self.model = model # public attributes
        self.__year = year #this is a private attributes and it could not be called directly

    def get_year(self): #define a way to call private attributes
        return self.__year

    def set_year(self,year):
        if year > 2000:
            self.__year = year
        else:
            print('Invalid year')

    def display_info(self):
        print(f"car: {self.make} {self.model}, year:{self.__year}")

my_car = car('toyota','camry','2010')

print(my_car.get_year())
#print(my_car.__year) #incur error, since __year is a private attribute

my_car.set_year(2022)
print(my_car.get_year())

my_car.display_info()
